//package netty.netty3;
//
//import org.jboss.netty.bootstrap.ServerBootstrap;
//import org.jboss.netty.channel.ChannelFactory;
//import org.jboss.netty.channel.ChannelPipeline;
//import org.jboss.netty.channel.ChannelPipelineFactory;
//import org.jboss.netty.channel.Channels;
//import org.jboss.netty.channel.socket.nio.NioServerSocketChannelFactory;
//
//import java.net.InetSocketAddress;
//import java.util.concurrent.Executors;
//
///**
// * Created by IntelliJ IDEA.
// * User: liuliwei
// * Date: 2017-09-22
// * Time: 下午3:29
// * Description: ${description}
// */
//public class DiscardServer {
//    public static void main(String[] args) {
//        ChannelFactory channelFactory = new NioServerSocketChannelFactory(Executors.newCachedThreadPool(), Executors.newCachedThreadPool());
//
//        ServerBootstrap bootstrap = new ServerBootstrap(channelFactory);
//
//        bootstrap.setPipelineFactory(new ChannelPipelineFactory() {
//            @Override
//            public ChannelPipeline getPipeline() throws Exception {
//                return Channels.pipeline(new DiscardServerHandler());
//            }
//        });
//
//        bootstrap.setOption("child.tcpNoDelay",true);
//        bootstrap.setOption("child.keepAlive",true);
//        bootstrap.bind(new InetSocketAddress(8080));
//    }
//}
